package com.fqgj.xjd.user.client.enums;

public enum UserGenderEnum {
    Male(1), Female(2), Others(3);

    private int code;

    UserGenderEnum(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static UserGenderEnum getEnumByCode(Integer code) {
        UserGenderEnum userGenderEnum = null;
        for (UserGenderEnum enumObj : UserGenderEnum.values()) {
            if (enumObj.getCode() == code) {
                userGenderEnum = enumObj;
                break;
            }
        }
        return userGenderEnum;
    }
}
